package com.miyake.client.datamanage;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

public class Data implements IsSerializable {
	private String key;
	private Double[] y;
	private List<Double[]> data = new ArrayList<Double[]>();
	private List<String[]> textData = new ArrayList<String[]>();
	private List<String> titles = new ArrayList<String>();
	private Integer titleRow;
	private String fileURL;
	private String filename;
	private String analysisURL;
	private Boolean parsed;
	private String filePluginKey;
	private String analysisPluginKey;
	private Double xmin;
	private Double xmax;
	public static final int SourceTypeFile = 0;
	public static final int SourceTypeAnalysis = 1;
	private Integer sourceType;
	private List<Parameter> parameters = new ArrayList<Parameter>();
	
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	public Double[] getY() {
		return y;
	}
	public void setY(Double[] y) {
		this.y = y;
	}	
	
	public void addData(Double[] d) {
		data.add(d);
	}
	
	public Double[] getData(int i) {
		return data.get(i);
	}
	
	public List<Double[]> getDataList() {
		return data;
	}
	
	
	public Integer getTitleRow() {
		return titleRow;
	}
	public void setTitleRow(Integer titleRow) {
		this.titleRow = titleRow;
	}
	public void addTextData(String[] textData, int rows) {
		String[] data = new String[rows];
		int length = textData.length;
		if (length > rows) {
			length = rows;
		}
		for (int i = 0; i < length; i++) {
			data[i] = textData[i];
		}
		this.textData.add(data);
	}
	
	public List<String[]> getTextData() {
		return this.textData;
	}
	public String getFileURL() {
		return fileURL;
	}
	public void setFileURL(String originalData) {
		this.fileURL = originalData;
	}
	
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	public List<String> getTitles() {
		return titles;
	}
	public void setTitles(List<String> titles) {
		this.titles = titles;
	}
	public String getAnalysisURL() {
		return analysisURL;
	}
	public void setAnalysisURL(String analysisURL) {
		this.analysisURL = analysisURL;
	}
	public Integer getSourceType() {
		return sourceType;
	}
	public void setSourceType(Integer sourceType) {
		this.sourceType = sourceType;
	}
	public Boolean isParsed() {
		return parsed;
	}
	public void setParsed(Boolean parsed) {
		this.parsed = parsed;
	}
	public void setFilePluginKey(String filePluginKey) {
		this.filePluginKey = filePluginKey;
	}
	public String getFilePluginKey() {
		return filePluginKey;
	}
	public void setAnalysisPluginKey(String analysisPluginKey) {
		this.analysisPluginKey = analysisPluginKey;
	}
	public String getAnalysisPluginKey() {
		return analysisPluginKey;
	}
	public void setXmin(Double xmin) {
		this.xmin = xmin;
	}
	public Double getXmin() {
		return xmin;
	}
	public void setXmax(Double xmax) {
		this.xmax = xmax;
	}
	public Double getXmax() {
		return xmax;
	}
	public void setParameters(List<Parameter> parameters) {
		this.parameters = parameters;
	}
	public List<Parameter> getParameters() {
		return parameters;
	}
	
}
